<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="expires" content="-1" >
        <title>Informes Medicos</title>
        <link rel="stylesheet" type="text/css" href="css/jmesa.css" id="paramCSS"/>
        <link href="css/styles.css" type="text/css" rel="stylesheet"/>
        <script type="text/javascript" src="/js/jquery.js"></script>
        <script type="text/javascript" src="/js/jmesa.js"></script>
        <link rel="stylesheet" type="text/css" href="iecss.css" />
    </head>

    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jmesa.js"></script>
    <script language="javascript">
        function f_open_window_max( aURL, aWinName ) {
            var wOpen;
            var sOptions;
            sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes';
            sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString();
            sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString();
            sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';
            wOpen = window.open( '', aWinName, sOptions );
            wOpen.location = aURL;
            wOpen.focus();
            wOpen.moveTo( 0, 0 );
            wOpen.resizeTo( screen.availWidth, screen.availHeight );
             return wOpen;
        }
        function f_open_window( aURL, aWinName ) {
            var wOpen;
            var sOptions;
            sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes';
            sOptions = sOptions + ',width=400' + (screen.availWidth - 10).toString();
            sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString();
            sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';
            wOpen = window.open( '', aWinName, sOptions );
            wOpen.location = aURL;
            wOpen.focus();
            wOpen.moveTo( 0, 0 );
            wOpen.resizeTo(650, 400);
            return wOpen;
        }
        function muestra_oculta(id){
            if (document.getElementById){
                var el = document.getElementById(id);
                el.style.display = (el.style.display == 'none') ? 'block' : 'none';
            }
        }
        window.onload = function(){
            muestra_oculta('contenido_a_mostrar');
        }
    </script>

    <body bgcolor="#e1ebf4">

        <table class="tabladatos" width="800px" align="center" border="0" cellpadding="0" cellspacing="0">
           <tr>
              <td>
                 <table width="100%" border="0" cellpadding="0" cellspacing="0">
                   <tr height=108px valign="middle">
                      <td width="*" align="center"><img border="0" src="images/banner4.jpg"></td>
                   </tr>
                 </table>
                 <div align="center" color="#003366" style="font-weight:bold;font-size:18px;">RESULTADOS EN LINEA</div>
                 <form id="resultadosForm" name="pacientesForm" action="IngresoServlet">
                   <table width="100%" class="tabladatos">
                     <tr>
                       <td>
                                    <table>
                                        <tr>
                                            <td class="tdLabel"><label for="u_usrnombr" class="label">PACIENTE:</label></td>
                                            <td><input type="text" name="u.usrnombr"
                                                       value="${persona.nombre1} ${persona.apePaterno}"
                                                       readonly="readonly" id="u_usrnombr" style="width:340px;"/></td>
                                        </tr>
                                        <tr>
                                            <td class="tdLabel"><label for="u_edad" class="label">EDAD:</label></td>
                                            <td><input type="text" name="u.edad" value="" readonly="readonly" id="u_edad"/></td>
                                        </tr>
                                        <tr>
                                            <td class="tdLabel"><label for="u_pnafecnac" class="label">FECHA DE NACIMIENTO:</label></td>
                                            <td><input type="text" name="u.pnafecnac" value="${persona.fechaNacimiento}" readonly="readonly" id="u_pnafecnac"/></td>
                                        </tr>

                                        <tr>
                                            <td class="tdLabel"><label for="u_telefono" class="label">TELEFONO:</label></td>
                                            <td
                                        ><input type="text" name="u.telefono" value="${persona.telefono}" readonly="readonly" id="u_telefono"/></td>
                                        </tr>
                                        <tr>
                                            <td class="tdLabel"><label for="u_usrcorreo" class="label">CORREO:</label></td>
                                            <td
                                        ><input type="text" name="u.usrcorreo" value="" readonly="readonly" id="u_usrcorreo" style="width:250px;"/></td>
                                        </tr>

                                    </table>

                        </td>
                                <td>
                                    <table>
                                        <tr>
                                            <td class="tdLabel"><label for="u_usrcodigo" class="label">DOCUMENTO:</label></td>
                                            <td
                                        ><input type="text" name="u.usrcodigo" value="${persona.docIdentidad}" readonly="readonly" id="u_usrcodigo"/></td>
                                        </tr>

                                        <tr>
                                            <td class="tdLabel"><label for="u_departamento" class="label">DEPARTAMENTO:</label></td>
                                            <td
                                        ><input type="text" name="u.departamento" value="" readonly="readonly" id="u_departamento"/></td>
                                        </tr>

                                        <tr>
                                            <td class="tdLabel"><label for="u_provincia" class="label">PROVINCIA:</label></td>
                                            <td
                                            ><input type="text" name="u.provincia" value="" readonly="readonly" id="u_provincia"/></td>
                                        </tr>

                                        <tr>
                                                <td class="tdLabel"><label for="u_distrito" class="label">DISTRITO:</label></td>
                                                <td
                                            ><input type="text" name="u.distrito" value="" readonly="readonly" id="u_distrito"/></td>
                                        </tr>

                                        <tr>
                                            <td class="tdLabel"><label for="u_direccion" class="label">DIRECCION:</label></td>
                                            <td
                                        ><input type="text" name="u.direccion" value="${persona.direccion}" readonly="readonly" id="u_direccion" style="width:250px;"/></td>
                                        </tr>

                                    </table>
                                </td>
                      </tr>
                   </table>
                   <div style="border:1px solid;position:absolute;left:50%;font-size:11px;top:288px;width:100px;text-align:center;background-color:#ffffcc;" align="right" id="contenido_a_mostrar">Filtrar columnas</div>
                   <div onmouseover="muestra_oculta('contenido_a_mostrar')" align="center" style="position:absolute;height:25px;width:800px;top:300px;cursor:pointer;" onmouseout="muestra_oculta('contenido_a_mostrar')" ></div>
        <div class="jmesa" >
            <table id="resultados"  border="0"  cellpadding="0"  cellspacing="0"  class="table"  width="100%" ><caption>Resultados</caption>
                <thead>
                <tr class="toolbar" >
                    <td colspan="6" >
                    <table border="0"  cellpadding="0"  cellspacing="1" >
                        <tr>
                            <td><img src="images/table/firstPageDisabled.gif"  alt="Primer PÃ¡gina" /></td>
                            <td><img src="images/table/prevPageDisabled.gif"  alt="PÃ¡gina Anterior" /></td>
                            <td><a href="javascript:setPageToLimit('resultados','2');onInvokeAction('resultados','next_page')"><img src="images/table/nextPage.gif"  title="PÃ¡gina Siguiente"  alt="PÃ¡gina Siguiente" /></a></td>
                            <td><a href="javascript:setPageToLimit('resultados','8');onInvokeAction('resultados','last_page')"><img src="images/table/lastPage.gif"  title="Ãltima PÃ¡gina"  alt="Ãltima PÃ¡gina" /></a></td>
                            <td><img src="images/table/separator.gif"  alt="Separator" /></td>
                            <td><select name="maxRows"  onchange="setMaxRowsToLimit('resultados', this.options[this.selectedIndex].value);onInvokeAction('resultados','max_rows')" >
                            <option value="10"  selected="selected">10 </option><option value="30" >30 </option><option value="100" >100 </option>
                            </select></td>
                            <td><img src="images/table/separator.gif"  alt="Separator" /></td>
                            <td><a href="javascript:onInvokeAction('resultados','filter')"><img src="images/table/filter.gif"  title="Filtrar"  alt="Filtrar" /></a></td>
                            <td><a href="javascript:removeAllFiltersFromLimit('resultados');onInvokeAction('resultados','clear')"><img src="images/table/clear.gif"  title="Limpiar Filtro"  alt="Limpiar Filtro" /></a></td>
                        </tr>
                    </table>
                  </td>
                </tr>
                <tr class="filter" >
                        <td></td>
                        <td><div class="dynFilter"  onclick="createDynFilter(this, 'resultados','sbffecsol')" ></div></td>
                        <td><div class="dynFilter"  onclick="createDynDroplistFilter(this,'resultados','desser',{'BILIRRUBINAS                                      ':'BILIRRUBINAS                                      ','CA-19-9                                           ':'CA-19-9                                           ','CA-72.4                                           ':'CA-72.4                                           ','CEA (ANTIGENO CARCINOEMBRIONARIO)                 ':'CEA (ANTIGENO CARCINOEMBRIONARIO)                 ','CREATININA                                        ':'CREATININA                                        ','DESHIDROGENASA LACTICA (DHL)':'DESHIDROGENASA LACTICA (DHL)','ECOGRAFIA ABDOMINAL':'ECOGRAFIA ABDOMINAL','ELECTROLITOS SUERO                                ':'ELECTROLITOS SUERO                                ','FOSFATASA ALCALINA':'FOSFATASA ALCALINA','GAMMA GLUTAMIL TRANSPEPTIDASA                     ':'GAMMA GLUTAMIL TRANSPEPTIDASA                     ','GLUCOSA':'GLUCOSA','HEMOGLOBINA HEMATOCRITO (HB-HTO)                  ':'HEMOGLOBINA HEMATOCRITO (HB-HTO)                  ','HEMOGRAMA':'HEMOGRAMA','HIERRO SERICO                                     ':'HIERRO SERICO                                     ','NICOTINA                                          ':'NICOTINA                                          ','PROTEINAS TOTALES Y FRACCIONADAS                  ':'PROTEINAS TOTALES Y FRACCIONADAS                  ','T.E.M. DE ABDOMEN TOTAL':'T.E.M. DE ABDOMEN TOTAL','T.E.M. DE CEREBRO AFILIADO':'T.E.M. DE CEREBRO AFILIADO','T.E.M. DE TORAX':'T.E.M. DE TORAX','TIEMPO DE PROTROMBINA-TP':'TIEMPO DE PROTROMBINA-TP','TORAX F-P':'TORAX F-P','TRANSAMINASAS                                     ':'TRANSAMINASAS                                     ','TRANSFERRINA (T.I.B.C.)':'TRANSFERRINA (T.I.B.C.)'})" ></div></td>
                        <td><div class="dynFilter"  onclick="createDynDroplistFilter(this,'resultados','nommedeje',{'ALFARO URQUIZO, JOSE ELIAS':'ALFARO URQUIZO, JOSE ELIAS','GOMEZ MORENO, HENRY LEONIDAS':'GOMEZ MORENO, HENRY LEONIDAS','RUIZ FIGUEROA, ELOY':'RUIZ FIGUEROA, ELOY','VALDIVIEZO LAMA, NATALIA ISABEL':'VALDIVIEZO LAMA, NATALIA ISABEL'})" ></div></td>
                        <td></td>
                        <td></td>
                </tr>
                <tr class="header" >
                        <td width="10px" ><div onmouseover="this.style.cursor='pointer'"  onmouseout="this.style.cursor='default'"  onclick="addSortToLimit('resultados','0','codigo','asc');onInvokeAction('resultados', 'sort')" >NRO</div></td>
                        <td><div onmouseover="this.style.cursor='pointer'"  onmouseout="this.style.cursor='default'"  onclick="addSortToLimit('resultados','1','sbffecsol','asc');onInvokeAction('resultados', 'sort')" >FECHA</div></td>
                        <td><div onmouseover="this.style.cursor='pointer'"  onmouseout="this.style.cursor='default'"  onclick="addSortToLimit('resultados','2','desser','asc');onInvokeAction('resultados', 'sort')" >EXAMENES</div></td>
                        <td><div onmouseover="this.style.cursor='pointer'"  onmouseout="this.style.cursor='default'"  onclick="addSortToLimit('resultados','3','nommedeje','asc');onInvokeAction('resultados', 'sort')" >MEDICO</div></td>
                        <td width="10px" ><div onmouseover="this.style.cursor='pointer'"  onmouseout="this.style.cursor='default'"  onclick="addSortToLimit('resultados','4','archivo','asc');onInvokeAction('resultados', 'sort')" >RESULTADO</div></td>
                        <td width="10px" ><div onmouseover="this.style.cursor='pointer'"  onmouseout="this.style.cursor='default'"  onclick="addSortToLimit('resultados','5','email','asc');onInvokeAction('resultados', 'sort')" >INFORME</div></td>
                </tr>
                </thead>

                <tbody class="tbody" >
                    <c:forEach varStatus="s"  items="${resultados}" var="resultado"  >
                <tr id="resultados_row1"  class="odd"  onmouseover="this.className='highlight'"  onmouseout="this.className='odd'" >
                        <td width="10px"  style="text-align: center;" >${s.index+1}</td>
                        <td style="text-align: center;" >${resultado.fechaf}</td>
                        <td>${resultado.examen}</td>
                        <td>${resultado.nombrepac}</td>
                        <td width="10px"  style="text-align: center;" > <A href="${pageContext.request.contextPath}/MostrarArchivo?nomarchivo=${resultado.rutaimagen}" target="_blank">
                                <img style="cursor:pointer;"  title="Abrir resultado"    border="0"  src="images/table/pdf.gif"></A> </td>
                        <td width="10px"  style="text-align: center;" ><A href="${pageContext.request.contextPath}/EditorTextoServlet?idservexamen=${resultado.idservexamen}" target="_blank">
                            <img style="cursor:pointer;"  title="Enviar resultado a correo electrÃ³nico"    border="0"  src="images/18_contact.gif" </A> </td>
                </tr>
                </c:forEach>
                </tbody>
                <tbody>
                <tr class="statusBar" >
                        <td align="left"  colspan="6" >Resultados 1 - 10 de 72.</td>
                </tr>
                </tbody>
            </table>
        </div>
        <script type="text/javascript" >

        </script>
                    </form>
                </td>
            </tr>
            <tr height="15px" valign="bottom">
                <td width="100%" colspan=2 height="30" valign="middle" align="center">&nbsp;</td>
            </tr>
        </table>

    </body>
</html>